package com.show.test;

import com.show.dao.IUserDao;
import com.show.entity.User;
import com.show.mybatis.factory.SqlSessionFactory;
import com.show.mybatis.sqlSession.SqlSession;

import java.util.List;

public class UserDaoTest2 {
    public static void main(String[] args) {
        SqlSessionFactory sqlSessionFactory = new SqlSessionFactory();

        SqlSession sqlSession = sqlSessionFactory.openSession();

        IUserDao userDao = sqlSession.getMapper(IUserDao.class);

        List<User> userList = userDao.findAll();

        for (User user : userList) {
            System.out.println(user);
        }
    }
}
